class Parent:
    def __init__(self):
        self.name = 'parent'

class Child(Parent):
    def __init__(self):
        super().__init__()  # 调用父类的__init__方法
        self.age = 18

if __name__ == "__main__":
    child = Child()
    print(child.name)  # 输出：parent
    print(child.age)   # 输出：18